package top.scauwlt;

import jdk.nashorn.internal.ir.annotations.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.scauwlt.annotation.RpcReference;
import top.scauwlt.annotation.RpcScan;

/**
 * @Author wmm
 * @Date 2022/7/27 22:36
 */
@Slf4j
@Component
public class HelloController {
    @RpcReference(version = "1.0", group = "message")
    private HelloService helloService;

    @RpcReference(version = "1.0", group = "description")
    private HelloService helloService2;


    public void testHello() {
        Hello hello = new Hello("this is message", "this is description");
        String res = helloService.hello(hello);
        log.info(res);
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        res = helloService2.hello(hello);
        log.info(res);
    }
}
